#include <iostream>
#include "functional.hpp"
using namespace std;

class A
{
public:
    int Add(int x, int y)
    {
        return x + y;
    }
};


int Add(int x, int y)
{
    return x + y;
}

int main()
{
    Functional<int(int, int)> f1([](int x, int y){return x + y;});
    A a;



    // Functional<int(int, int)> f2(&a,  &A::Add);
    Functional<int(int, int)> f3(&Add);

    cout << f1(2, 4) << endl;
    // cout << f2(2, 4) << endl;
    cout << f3(2, 4) << endl;

    f1 = std::move(f3);

    cout << f1(2, 4) << endl;
    // // cout << f2(2, 4) << endl;
    // cout << f3(2, 4) << endl;

    return 0;
}